package ch.trackedbean.client.handlers;

import java.util.*;
import ch.trackedbean.client.*;
import ch.trackedbean.loaders.lists.*;
import ch.trackedbean.server.*;
import ch.trackedbean.server.data.dom.*;

/**
 * {@link IListLoader} delegating the call to {@link Server#getDomObjects(Class)}.
 * 
 * @author hautle
 */
public class DefaultListLoader implements IListLoader<Dom, Void, Void, Void> {
    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isCachable(Class<Dom> type, Void subType, Map<Void, Void> settings) {
        return true;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<Dom> load(Class<Dom> type, Void subType, Map<Void, Void> settings) throws Exception {
        return ServerAccess.ME.getSrv().getDomObjects(type);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Class<Dom> getType() {
        return Dom.class;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isSuperLoader() {
        return true;
    }
}
